from peewee import *
from utils.common import *


class ToDo(Model):
    """
        todo_id, int, auto, key
        name, str, describe of todo task, not null
        create_time, datetime, auto
        complete_time, datetime, None when incomplete, get now time when finish
        sign, int, 1:new task 0:old task
    """
    todo_id = AutoField(primary_key=True)
    name = CharField(null=False)
    create_time = DateTimeField(null=False)
    complete_time = DateTimeField(null=True)
    sign = IntegerField(null=False)

    class Meta:
        database = SqliteDatabase(database=get_sqlite_path())


ToDo.create_table()


